<?php

namespace App\Models;

use App\Events\DeviceSaving;
use Illuminate\Database\Eloquent\Model;

/**
 * @property Manager $manager
 */
class Device extends Model
{
    //
//    public $timestamps = false;
    protected $guarded = [];

    public function manager()
    {
        return $this->belongsTo(Manager::class, 'manager_id');
    }
    public function phone_number_1()
    {
        return $this->belongsTo(PhoneNumber::class, 'phone_number_1_id');
    }
    public function phone_number_2()
    {
        return $this->belongsTo(PhoneNumber::class, 'phone_number_2_id');
    }

    public function getFullTagAttribute($value)
    {
        return "$this->id $this->name $this->device_id ";
    }

}
